﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_UC_Thongtincanhan : System.Web.UI.UserControl
{
    BUS_Customers Customer;
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = ("Thông tin cá nhân");
        if (Session["UserName"] == null)
        {
            Response.Redirect("Trangchu.aspx");
        }
        else
        {
            LoadData();
        }
        
    }

    public void LoadData()
    {
        Customer = new BUS_Customers();
        infoUser.DataSource = Customer.Customers_GetByID(Session["UserName_Id"].ToString());
        infoUser.DataBind();
    }
    public string GioiTinh(bool GT)
    {
        if (GT)
        {
            return "Nam";
        }
        else
        {
            return "Nữ";
        }
        
    }
    public string DayFomat(DateTime date)
    {
        return string.Format("{0:dd/MM/yyyy}", date);
        
    }
    public string Province(string ID)
    {
        BUS_Province data = new BUS_Province();
        return data.Province_GetByID(ID).Rows[0]["Name"].ToString();
    }
    protected void ChangeInfo_Click(object sender, EventArgs e)
    {
        Response.Redirect("Trangcanhan.aspx?action=doithongtin");
    }
    protected void ChangePassWord_Click(object sender, EventArgs e)
    {
        Response.Redirect("Trangcanhan.aspx?action=doimatkhau");
    }
}